Field
The described embodiments relate to computing devices. More specifically, the described embodiments relate to relocatable and resizable tables in computing devices.
Related Art
Some computing devices use tables to keep records of devices, the tables including information useful for interacting with the devices. For example, in some computing devices, an input-output management unit (IOMMU) maintains an active device table that is used to handle interactions with peripheral devices (e.g., input-output (IO) devices). In such computing devices, the IOMMU may use information from or based on the active device table to handle transactions for peripheral devices, interrupts from/associated with peripheral devices, address translations for addresses in requests from peripheral devices, and/or other operations. In some of these computing devices, the active device table is stored in a main memory of the computing device. For example, the active device table may include 65,536 256-bit entries, each entry configured to store device information for a peripheral device, and thus may be stored in a 2 Mb block/region (contiguous or segmented) in the main memory.
In some computing devices, tables stored in the main memory may be resized and/or relocated during operation of the computing device. For example, in some computing devices, an operating system or hypervisor may initially allocate, for a table, a block of memory of an original size at an original location in memory (e.g., a table with 24 64-byte entries would be allocated 1,536 bytes starting from a given address A in memory). During operation, e.g., as demand for the table and/or memory space increases or decreases, the table may be relocated to a new location in memory, perhaps while also being resized (i.e., made larger or smaller), and/or may be resized at the original location in memory.
Although resizing and/or relocating tables might be beneficial, for certain tables, resizing and/or relocating the tables is not permitted. For example, the above-described active device table is typically allocated at startup (or “statically” allocated), and is not permitted change size and/or location during the operation of the computing devices. Because the computing device may have a varying number of peripheral devices (e.g., devices that are plugged and unplugged from the computing device, become available/unavailable, etc.), may not have 65,536 peripheral devices, and/or different computing devices may be configured to use the active device table in different ways, having the active device table statically allocated can lead to sub-optimal operation for the computing device. For example, the active device table may consume more memory than necessary, may not have enough space to store device information for certain peripheral devices, and/or be located in a sub-optimal location in the memory.
Throughout the figures and the description, like reference numerals refer to the same figure elements.